<%-- 
    Document   : programacionItinerario2
    Created on : 11/06/2014, 02:57:30 PM
    Author     : USUARIO
--%>

<%@page import="Beans.*"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <!-- bootstrap 3.0.2 -->
        <link href="../../css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <!-- font Awesome -->
        <link href="../../css/font-awesome.min.css" rel="stylesheet" type="text/css" />
        <!-- Ionicons -->
        <link href="../../css/ionicons.min.css" rel="stylesheet" type="text/css" />
        <!-- Theme style -->
        <link href="../../css/AdminLTE.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <% int idI = Integer.parseInt(request.getParameter("idI"));
           int idS = Integer.parseInt(request.getParameter("idS"));
           int idR = Integer.parseInt(request.getParameter("idR"));
           int idRG = Integer.parseInt(request.getParameter("idRG"));
           int idA = Integer.parseInt(request.getParameter("idA"));
        %>
    <section class="content">
        <div class="row">
            <div class="col-xs-4">
                <div class="box box-primary">
                    <div class="box-header">
                        <h3 class="box-title">Programación</h3>
                    </div><!-- /.box-header -->
                    <div class="box-body">
                        <div class="row">
                            <form role="form" method="post" action="../../controlador" name="f1">
                                <input type="hidden" value="operProg" name="accion"/>
                                <input type="hidden" value="I" name="accionBD"/>
                                <input type="hidden" value="1" name="userCrea"/>
                                <input type="hidden" name="idI" value="<%=idI%>"/>
                                <input type="hidden" name="idS" value="<%=idS%>"/>
                                <input type="hidden" name="idR" value="<%=idR%>"/>
                                <input type="hidden" name="idRG" value="<%=idRG%>"/>
                                <input type="hidden" name="idA" value="<%=idA%>"/>
                                <div class="col-xs-12" style="margin-bottom:20px;">
                                    <label>Dia(s) que saldrá el servicio</label>
                                    <div class="checkbox" style="margin-top:0px;">
                                        <input type="checkbox" name="dias" value="lunes">Lun&ensp;
                                        <input type="checkbox" name="dias" value="martes">Mar&ensp;
                                        <input type="checkbox" name="dias" value="miercoles">Mie&ensp;
                                        <input type="checkbox" name="dias" value="jueves">Jue&ensp;
                                        <input type="checkbox" name="dias" value="viernes">Vie&ensp;
                                        <input type="checkbox" name="dias" value="sabado">Sab&ensp;
                                        <input type="checkbox" name="dias" value="domingo">Dom&ensp;
                                    </div>                                    
                                </div>
                                <div class="col-xs-9" style="margin-bottom:20px;">
                                    <label>Sale con el Bus</label>
                                    <select class="form-control" name="idVeh">
                                        <option selected>Seleccione bus..</option>
                                        <% ArrayList<ModVeh_Bus> lista = new ModVeh_Bus().listarBus();
                                               for(int i=0; i<lista.size(); i++)
                                               {    ModVeh_Vehiculo v = new ModVeh_Vehiculo().ObtenerVehiculoById(lista.get(i).getIdvehiculo());
                                                    ModVeh_TipoDeBus tp = new ModVeh_TipoDeBus().obtenerTipoBus(lista.get(i).getIdtipobus());
                                        %>
                                        <option value="<%=v.getIdvehiculo()%>">
                                            <%=lista.get(i).getNombre()%> <%=tp.getNombre()%>&ensp;&#8211&ensp;
                                            <%=v.getPlaca()%>&ensp;&#8211&ensp;
                                            <%=v.getModelo()%>
                                        </option>
                                        <%                                                  
                                                }
                                        %>
                                    </select>                                   
                                </div>
                                <div class="col-xs-9" style="margin-bottom:20px;">
                                    <label>Sale con el Chofer</label>
                                    <select class="form-control" name="idEmp">
                                        <option selected>Seleccione chofer..</option>
                                        <%  ModEmp_Cargo c = new ModEmp_Cargo().obtenerIdByCargoChofer("Chofer");
                                            ModEmp_Empleado e = new ModEmp_Empleado();
                                            ArrayList<ModEmp_Empleado> lis = new ArrayList<ModEmp_Empleado>();
                                            lis = e.obtenerEmpleadoByIdCargo(c.getIdcargo());
                                            for(int i=0; i<lis.size(); i++)
                                            {   ModEmp_Persona p = new ModEmp_Persona().obtenerPersona(lis.get(i).getFk_idpersona());
                                        %>
                                        <option value="<%=lis.get(i).getIdempleado()%>"><%=p.getNombre()%> <%=p.getApepaterno()%> <%=p.getApematerno()%>&ensp;&#8211&ensp;<%=p.getNumerodocumento()%></option>                                        
                                        <%
                                            }
                                        %>
                                    </select>                                    
                                </div>
                                <div class="col-xs-9" style="margin-bottom:20px;">
                                    <a href="#">
                                        <button type="submit" title="Guardar Programación" class="btn btn-primary">
                                            Asignar
                                        </button>
                                    </a>
                                </div>                                
                            </form>                                              
                        </div>                                            
                    </div>
                </div>
            </div>
        </div>
    </section>
        
        <!-- jQuery 2.0.2 -->
        <script src="../../js/jquery.min.js"></script>
        <!-- Bootstrap -->
        <script src="../../js/bootstrap.min.js" type="text/javascript"></script>
        <!-- AdminLTE App -->
        <script src="../../js/app.js" type="text/javascript"></script>
        
    </body>
</html>
